/**
 *
 * History:
 *   2010-6-16 19:48:40 Created by ZGong
 */
package gz.gae.blog.widget;

import javax.cache.Cache;
import javax.cache.CacheException;
import javax.cache.CacheManager;
import java.util.Collections;


/**
 * Created by ZGong.
 *
 * @version 1.0 2010-6-16 19:48:40
 */
public class TodayMood {
    private static Cache cache;
    public static final String TODAY_MOOD = "TODAY_MOOD";

    static {
        try {
            cache = CacheManager.getInstance().getCacheFactory().createCache(Collections.emptyMap());
        } catch (CacheException e) {
            // ...
        }
    }

    public static void setMood(String mood) {
        cache.put(TODAY_MOOD, mood);
    }

    public static String getMood() {
        return (String) cache.get(TODAY_MOOD);
    }
}
